#include #include using std::cin; using std::cout; using std::endl; char upper(char c) { char result = c; if(c >= 'a' && c <= 'z') { c -= 32; } return c; } int indexOfFirstVowel(char s[]) { int result = -1; int i = 0; while(s[i] != '\0' && result == -1) { if(s[i] == 'A' || s[i] == 'E' ||s[i] == 'I' ||s[i] == 'O' ||s[i] == 'U' || s[i] == 'a' || s[i] == 'e' ||s[i] == 'i' ||s[i] == 'o' ||s[i] == 'u' ) { result = i; } i++; } return result; } void main() { char s[1000]; cin.getline(s,1000); int i; // store the index of the first space in the string s into i char* p; //p is a pointer to a char //a pointer is a variable that stores an address of another variable //p = s + 5; //strchr returns the address of the first occurance of the char starting //from s, going forward until it finds a \0 //it returns address 0 if it does not find the char //NULL - is the address 0 //\0 is the null terminator //0 is zero //false is zero //p = strchr(s,' '); //if(p != NULL) //{ // i = (int)(p-s); // cout << i << endl; //} //cout << upper('t') << endl; //p = strstr(s,"waldo"); //if(p != NULL) //{ // i = (int)(p-s); // cout << i << endl; //} //cout << indexOfFirstVowel(s) << endl; //int j = indexOfFirstVowel(s); //char prefix[100]; //strcpy(prefix,s); //prefix[j] = '\0'; //strcpy(s,s+j); //strcat(s,prefix); //strcat(s,"ay"); //cout << s << endl; }